package com.blog.common.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.blog.common.domain.annotation.Convert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 照片
 * </p>
 *
 * @author Valerie
 * @since 2023-03-11
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("tb_photo")
@ApiModel(value = "Photo对象", description = "照片")
public class Photo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("相册id")
    @TableField("album_id")
    private Long albumId;

    @ApiModelProperty("照片名")
    @TableField("photo_name")
    private String photoName;

    @ApiModelProperty("照片描述")
    @TableField("photo_desc")
    private String photoDesc;

    @ApiModelProperty("照片地址")
    @TableField("photo_src")
    @Convert
    private String photoSrc;

    @ApiModelProperty("是否删除")
    @TableField("is_delete")
    @TableLogic
    private Integer isDelete;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;
}
